//
//  SHCourierQuotationListController.m
//  youjian03
//
//  Created by Dadeso on 14/10/27.
//  Copyright (c) 2014年 com.shouhuobao. All rights reserved.
//

#import "SHCourierQuotationListController.h"

@interface SHCourierQuotationListController ()
@property (nonatomic,retain) UITableView * courierListTableView;
@end

@implementation SHCourierQuotationListController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

//创建抢单快递列表
-(void)creatCourierGetOrderTB{
    UITableView * tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, HMScreenW, HMScreenH) style:UITableViewStylePlain];
    tableView.delegate = self;
    tableView.dataSource = self;
    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    tableView.backgroundColor = [UIColor redColor];
    self.courierListTableView = tableView;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"已回应";
    
    [self creatCourierGetOrderTB];
}

#pragma courier tb about

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 193.0f;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NSString * cellName = [NSString stringWithFormat:@"courierList%d%d",indexPath.section,indexPath.row];
    SHCourierQuotationListCell * cell = [tableView dequeueReusableCellWithIdentifier:cellName];
    if (!cell) {
        cell = [[SHCourierQuotationListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellName];
        cell.delegate = self;
    }
    return cell;
}

-(void)makeSureZheCourier:(NSInteger)indexPathRow{
    NSDictionary *dic = @{@"token":self.courierToken,@"offerId":self.cellDataModel.courierOfferId};
    [SHHTTPTOOL PostWithDic:dic andAction:@"userNailOrder" success:^(id responseObj) {
        
    } failure:^(NSError *error) {
        
    }];
}

-(void)refuseZheCourier:(NSInteger)indexPathRow{
    NSDictionary *dic = @{@"token":self.courierToken,@"offerId":self.cellDataModel.courierOfferId};
    [SHHTTPTOOL PostWithDic:dic andAction:@"userIgnoreOffer" success:^(id responseObj) {
        
    } failure:^(NSError *error) {
        
    }];

}

-(void)payCashMoney{

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
